package com.itheima.demo2;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class TimeDemo2 {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime dateTime = now.minusYears(3).minusMonths(5).minusDays(7).minusHours(4);
        System.out.println(dateTime);
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH-mm-ss");
        String format = dateTimeFormatter.format(dateTime);
        System.out.println(format);
    }
}
